package model;


public class BeanDonneesGraphes {

	private Question question;
	private int[][] tab;
	
	public BeanDonneesGraphes(Question q){
		question = q;
		tab = new int[10][2];
	}
	
	public Question getQuestion() {
		return question;
	}
	public void setQuestion(Question question) {
		this.question = question;
	}
	public int[][] getTab() {
		return tab;
	}
	public void setTab(int[][] tab) {
		this.tab = tab;
	}

	public void addNumReponse(int num){
		if(!numExists(num))
		for(int i=0; i<tab.length; i++){
			if(tab[i][0] == 0){
				tab[i][0] = num;
				return;
			}
				
				
		}
	}
	
	private boolean numExists(int num){
		boolean exist = false;
		for(int i=0; i<tab.length; i++){
			if(tab[i][0] == num)
				exist = true;			
		}
		
		return exist;
	}
	
	public void incNombreReponse(int num){
		for(int i=0; i<tab.length; i++){
			if(tab[i][0] == num)
				tab[i][1] ++;
				
		}
	}
	

}
